//
//  PersonInfoView.swift
//  movieInfo
//
//  Created by zhangkai on 2023/5/14.
//

import UIKit

class PersonInfoView: UIView {

    var img = MIImageView(frame: CGRect(x: 0, y: 0, width: 70, height: 70))
    
    var nameLabel = UILabel()
    var infoLabel = UILabel()
    var timeLabel = UILabel()
    
    var infoView = UITextView()


    override init(frame: CGRect) {
        super.init(frame: frame)
        

        
        addSubview(img)
        img.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(10)
//            make.left.equalToSuperview().offset(15)
            make.centerX.equalToSuperview()
            make.width.equalTo(150)
            make.height.equalTo(150)
        }
        img.backgroundColor = .white
        
        addSubview(nameLabel)
        nameLabel.numberOfLines = 2
        nameLabel.font = UIFont.systemFont(ofSize: 24, weight: .regular)
        nameLabel.textColor = .label
        nameLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(img.snp.bottom).offset(12)
        }
        nameLabel.text = "名称"
        
        addSubview(timeLabel)
        timeLabel.numberOfLines = 2
        timeLabel.font = UIFont.systemFont(ofSize: 16, weight: .regular)
        timeLabel.textColor = .label
        timeLabel.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(15)
            make.top.equalTo(nameLabel.snp.bottom).offset(15)
//            make.right.equalToSuperview().offset(-15)
        }
        timeLabel.text = "2022-12-12"
        
        
        addSubview(infoLabel)
        infoLabel.numberOfLines = 0
        infoLabel.font = UIFont.systemFont(ofSize: 14, weight: .regular)
        infoLabel.textColor = .label
        infoLabel.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(15)
            make.right.equalToSuperview().offset(-15)
            make.top.equalTo(timeLabel.snp.bottom).offset(12)
//            make.right.equalToSuperview().offset(-15)
        }
        infoLabel.text = "genres:genres"
        
        
        addSubview(infoView)
        infoView.isEditable = false
        infoView.font = UIFont.systemFont(ofSize: 14, weight: .regular)
        infoView.textColor = .label
        infoView.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(15)
            make.right.equalToSuperview().offset(-15)
            make.top.equalTo(timeLabel.snp.bottom).offset(12)
            make.height.equalTo(150)
//            make.right.equalToSuperview().offset(-15)
        }
        infoView.backgroundColor = .white
        
        
        

    }
    
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
